home *** CD-ROM | disk | FTP | other *** search
Java Source | 1997-08-19 | 891 b | 42 lines |
- package macrolanguage;
- import java.io.OutputStream;
- import java.util.Vector;
-
- /**
- * The SimpleStream class implements OutputStream and simply stores all that
- * is written to the output stream. Its purpose is to allow programs who
- * only use text streams to implement the stream in a simple way.
- **/
- public class SimpleStream extends java.io.OutputStream
- {
- public void write(int i)
- {
- stringsWritten.addElement(Integer.toString(i));
- }
-
- public void write(byte[] data)
- {
- stringsWritten.addElement(new String(data));
- }
-
- public void write(byte[] data, int start, int offset)
- {
- stringsWritten.addElement(new String(data,start,offset));
- }
-
- public void flush()
- {
- }
-
- public void close()
- {
- }
-
- public Vector getStringsWritten()
- {
- return(stringsWritten);
- }
-
- private Vector stringsWritten = new Vector();
- }
-